// 用户类型
export interface User {
  id: string;
  username: string;
  email: string;
  phone: string;
  avatar?: string;
}

// 管理员用户类型
export interface AdminUser {
  id: string;
  username: string;
  email: string;
  role: 'admin' | 'super_admin';
  roleId?: string; 
  password?: string; 
}

// 商品分类类型
export interface Category {
  id: string;
  name: string;
  icon: string;
}

// 商品类型
export interface Product {
  id: string;
  name: string;
  description: string;
  price: number;
  originalPrice?: number;
  image: string;
  images: string[];
  categoryId: string;
  stock: number;
  sales: number;
  isHot: boolean;
  createdAt: string;
}

// 购物车商品类型
export interface CartItem {
  id: string;
  productId: string;
  product: Product;
  quantity: number;
  selected: boolean;
}

// 收货地址类型
export interface Address {
  id: string;
  name: string;
  phone: string;
  province: string;
  city: string;
  district: string;
  detail: string;
  isDefault: boolean;
}

// 订单商品类型
export interface OrderItem {
  id: string;
  productId: string;
  product: Product;
  quantity: number;
  price: number;
}

// 订单类型
export interface Order {
  id: string;
  userId: string;
  items: OrderItem[];
  totalAmount: number;
  status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled';
  address: Address;
  createdAt: string;
  updatedAt: string;
}

// 权限类型
export type Permission = 'dashboard' | 'product' | 'category' | 'order' | 'role';

// 角色类型
export interface Role {
  id: string;
  name: string;
  permissions: Permission[];
}
